2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Graphics;
7 using Microsoft.Xna.Framework.Input;
9 namespace SuperPolarity
11 class GameScreen : Screen
13 public GameScreen(SuperPolarity newGame) : base(newGame) {}
15 public override void Initialize()
17 InputController.RegisterEventForButton("changePolarity", Buttons.A);
18 InputController.RegisterEventForKey("changePolarity", Keys.Z);
20 InputController.RegisterEventForButton("shoot", Buttons.X);
21 InputController.RegisterEventForKey("shoot", Keys.X);
24 public override void LoadContent()
26 Vector2 playerPosition = new Vector2(Game.GraphicsDevice.Viewport.TitleSafeArea.X, Game.GraphicsDevice.Viewport.TitleSafeArea.Y + Game.GraphicsDevice.Viewport.TitleSafeArea.Height / 2);
28 Renderer.CheckIn(ActorFactory.CreateMainShip(playerPosition));
29 Renderer.CheckIn(ActorFactory.CreateShip(Ship.Polarity.Positive, new Vector2(200, 200)));
30 Renderer.CheckIn(ActorFactory.CreateShip(Ship.Polarity.Negative, new Vector2(400, 200)));
33 public override void Update(GameTime gameTime)
35 InputController.UpdateInput();
36 ActorManager.Update(gameTime);
39 public override void Draw(SpriteBatch spriteBatch)
41 Renderer.Draw(spriteBatch);